﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/main.master" AutoEventWireup="true" CodeBehind="StoreKeeper_ViewPromotionItemList.aspx.cs" Inherits="CS424_9pts.Administration.StoreKeeper_ViewPromotionItemList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="PromotionID" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:CommandField ShowEditButton="True" />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="Num" HeaderText="Num" SortExpression="Num" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>" 
        SelectCommand="SELECT [PromotionID], [Name], [Num] FROM [Promotion]" 
        DeleteCommand="DELETE FROM [Promotion] WHERE [PromotionID] = @PromotionID" 
        InsertCommand="INSERT INTO [Promotion] ([Name], [Num]) VALUES (@Name, @Num)" 
        UpdateCommand="UPDATE [Promotion] SET [Name] = @Name, [Num] = @Num WHERE [PromotionID] = @PromotionID">
        <DeleteParameters>
            <asp:Parameter Name="PromotionID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Num" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Num" Type="Int32" />
            <asp:Parameter Name="PromotionID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>


</asp:Content>
